from enum import Enum


class StockCategoryEnum(Enum):
    # 股票分类枚举
    UNIQUE = ("unique", "大盘唯一")
    SECTOR_ETF = ("sector_etf", "板块ETF")
    INDIVIDUAL = ("individual", "个股")

    def __init__(self, key: str, description: str):
        self.key = key
        self.description = description

    def __str__(self):
        return self.key

    @classmethod
    def get_category_list(cls):
        """获取股票分类描述列表"""
        return [category.description for category in cls]

    @classmethod
    def get_default(cls):
        """获取默认分类"""
        return cls.INDIVIDUAL.description
